import { getTagList, ClickAirticleTag } from "@/services";
import { makeAutoObservable } from "mobx"
import { IDetail } from '@/utils/interface'

class Tag {
    constructor() {
        makeAutoObservable(this);
    }
    tagList = [];
    tagDetail: IDetail[] = [];

    // 获取标签列表
    async getTagList() {
        let result = await getTagList();
        if (result.statusCode === 200) {
            this.tagList = result.data
        }
    }
    // 点击文章标签
    async ClickAirticleTag(value: string, pagesize: number) {
        let result = await ClickAirticleTag(value, pagesize)
        if (result.statusCode === 200) {
            this.tagDetail=result.data[0]
        }
        
    }

}

export default Tag;